$(document).ready(function() {
	$.formValidator.initConfig({
		validatorGroup:"2",
		formID : "newArticleForm",
		debug : false,
		submitOnce : true,
		onSuccess: function() {
			$("#newArticleForm").submit();
		}
	});
	
	$("#title").formValidator({
		validatorGroup:"2",
		empty:true,
		onShow: "请输入标题",
		onFocus: "允许输入汉字、字母、数字",
		onCorrect: "输入正确",
		onEmpty:"标题可以为空"
	}).regexValidator({
		regExp: "letterAndNoAndHanzi",
		dataType: "enum",
		onError: "标题格式不正确"
	});
	
	$("#content").formValidator({
		validatorGroup:"2",
		onShow: "请输入囧事",
		onFocus: "囧事必须输入10 - 1000字哦！",
		onCorrect: "输入正确"
	}).inputValidator({
		min: 10,
		max: 1000,
		empty: {
			leftEmpty: false,
			rightEmpty: false,
			emptyError: "请输入囧事"
		},
		onError: "囧事为必填项，10 - 1000字！"
	});
});